/**************************************************************

This do file creates appendix figure 8 and does the DID analysis that is discussed in the Section 5.6;
	
**************************************************************/
capture log close
capture program drop _all
capture macro drop _all
estimates drop _all
set matsize 1000
drop _all
set more off

*UPDATE PATH NAMES;
global ched_data 
global output 

#delimit ; 
***************************************************************;
use "${ched_data}analysis_sample.dta"; 
***************************************************************;
*GRAPH OF NUMBER OF NURSES IN PHILIPPINES OVER TIME;
preserve;
collapse (sum) nurse_midwife, by(year);
replace nurse_midwife=. if nurse_midwife==0;

twoway (line nurse_midwife year),
	ytitle("Number of Nurses and Midwives") ylabel(,format(%9.0fc) nogrid)
	plotregion(fcolor(white)) graphregion(fcolor(white));
	
graph export "${output}Main Figures/nurse_overtime.pdf", replace;	

restore;

***************************************************************;
*DID ANALYSIS OF NUMBER OF NURSES IN PHIL OUT OF 1990 POPULATION;
global controls_yr emp_f_2564_90_yr* emp_m_2564_90_yr* female_90_yr* age_90_yr*;

gen post2010_high=post2010*high1;

gen nurse_midwife_popsh=(nurse_midwife/pop90)*100;

tab year, gen(yr); 
tab provcode, gen(prov_);


*MAIN SPEC IN TEXT;
reg nurse_midwife_popsh post2010_high i.provcode i.year $controls_yr, cluster(province);
estimates store spec2;
sum nurse_midwife_popsh if year==1990;
scalar dep_mean=r(mean);
estadd scalar dep_mean=dep_mean;

